package com.translation.verb;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.translation.verb.de.DEBatchFactory;
import com.translation.verb.en.ENBatchFactory;
import com.translation.verb.es.ESBatchFactory;
import com.translation.verb.fr.FRBatchFactory;

public abstract class BatchFactory {

	private static Map<String, BatchFactory> catalog;

	private static void init() {
		catalog = new HashMap<String, BatchFactory>();
		catalog.put("es", new ESBatchFactory());
		catalog.put("en", new ENBatchFactory());
		catalog.put("de", new DEBatchFactory());
		catalog.put("fr", new FRBatchFactory());
	}

	public static BatchFactory getInstance(String locale) {
		if (catalog == null) {
			init();
		}
		return catalog.get(locale);
	}

	public abstract List<? extends IteratorBatch<String>> getBatches();

}
